class Telephone1 {
    String brand, number;
    double dialledTime;
    double rate;
    Telephone1(String b, String n) {
        brand = b;
        number = n;
    }

    String getBrand( ) {
        return brand;
    }
    String getNumber( ) {
        return number;
    }
    double getRate( ){
        return rate;
    } //返回费率值
    double getDialledTime( ) {
        return dialledTime;
    }


    void setBrand(String b) {
        brand = b;
    }
    void setNumber(String n) {
        number = n; // 设置电话号码
    }
    void setRate(double r) {
        rate = r;
    }
    void setDialledTime(double d) {
        dialledTime = d;
    }
    double callCost( ) {
        return dialledTime * rate;
    }
    void display( ) {
        System.out.println("电话品牌: "+ brand +" 电话号码: "+ number);
        System.out.println("通话时间: "+ dialledTime +" 费率: "+ rate);
        System.out.println("话费: "+ callCost( ));
    }
}
class Mobilephone extends Telephone1 {
    String network;
    double receivedTime;
    Mobilephone(String b, String num, String net) {
        super(b, num);
        network = net;
    }
    String getNetwork( ) { return network; }
    double getReceivedTime( ) { return receivedTime; }
    void setNetwork(String n) {
        network = n;
    }
    void setReceivedTime(double d) {
      receivedTime = d;  //设置被叫时间
    }
    double callCost( ) {
        return (dialledTime + 0.5*receivedTime) * rate;
    }
    void display( ) {
        System.out.println("电话品牌: "+ brand +" 电话号码: "+ number
                +" 网络: "+ network);
        System.out.println("主叫时间: "+ dialledTime +" 被叫时间: " +
                receivedTime +" 费率: "+ rate);
        System.out.println("话费: "+ callCost( ));
    }
}
public class Telephone {
    public static void main(String[] args) {
        Telephone1 tel;
        Mobilephone mobile;
        tel = new Telephone1("TCL", "8309600");
        mobile = new Mobilephone("Huawei", "13007091010","5G");
        tel.setRate(0.2);
        tel.setDialledTime(150);
        mobile.setRate(0.4);
        mobile.setReceivedTime(80); //设置主叫时间为80
        mobile.setReceivedTime(120);
        tel.display( );
        System.out.println( );
        mobile.display(); //显示移动电话的信息
    }
}
